Skip to content

Conversation

@xujin-zhang
Copy link
Contributor

@xujin-zhang xujin-zhang commented Apr 6, 2021

Description

This PR introduces "SystemAssigned" identity support & "defaultIdentity" for Cosmos DB CMK related features.

  1. SystemAssigned MSI:
  • Enable during account creation
    az cosmosdb create --resource-group $rg --name $dbname ...(omitted) --assigned-identity

  • Enable on existing account
    az cosmosdb identity assign --resource-group $rg --name $dbname

  • Disable/Remove identity
    az cosmosdb identity remove --resource-group $rg --name $dbname

  • Show identity
    az cosmosdb identity show --resource-group $rg --name $dbname

  1. Default Identity
    User can set the "defaultIdentity" during db account provision or update.
    For example:
    az cosmosdb update --resource-group $rg --name $dbname ...(omitted) --default-identity SystemAssignedIdentity.

Today the allowed "defaultIdentity" can be "SystemAssignedIdentity" and "FirstPartyIdentity". We will support more in near future. If the user doesn't specify the --default-identity, then the default identity of the account will not be updated.

Notice in our internal RP code, the change of default identity will have some key vault access validation, which indicate if the request doesn't pass the validation then the request will be rejected as a Bad Request to the user, and the default identity will stay unchanged.

Testing Guide

We have live tests in test_cosmosdb_commands.py, the manual tests would be similar to that in the "test_cosmosdb_managed_service_identity".

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@xujin-zhang xujin-zhang requested a review from Juliehzl as a code owner April 6, 2021 08:57
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 6, 2021

Cosmos DB

@yonzhan yonzhan requested a review from evelyn-ys April 6, 2021 09:23
@yonzhan yonzhan added this to the S186 milestone Apr 6, 2021
Copy link
Member

@evelyn-ys evelyn-ys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add examples for new changed commands in _help.py so that customers will be aware.

Copy link
Contributor

@Juliehzl Juliehzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another concern is that should we support assign identity for existing cosmosdb resource with az cosmosdb update command?

Copy link
Contributor Author

@xujin-zhang xujin-zhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another concern is that should we support assign identity for existing cosmosdb resource with az cosmosdb update command?

We don't support that because we want to enforce the customer to use "az cosmosdb identity XXX" once the db account is created. So there's no need to support that for az cosmosdb update. I think Azure storage support that but as I remember Azure VM doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants